home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000261_simon@lia.di.epfl.ch_Mon Feb 7 04:28:01 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  4KB

  1. Received: from liasun6.epfl.ch by cs.umb.edu with SMTP id AA26043
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Mon, 7 Feb 1994 04:28:01 -0500
  3. Received: by liasun6.epfl.ch (Smail3.1.28.1 #58)
  4.     id m0pTSG7-0002PeC; Mon, 7 Feb 94 10:27 MET
  5. Message-Id: <m0pTSG7-0002PeC@liasun6.epfl.ch>
  6. Date: Mon, 7 Feb 94 10:27 MET
  7. From: simon@lia.di.epfl.ch (Simon Leinen)
  8. To: "K. Berry" <kb@cs.umb.edu>
  9. Cc: leslie@noether.mts.jhu.edu, tex-k@cs.umb.edu
  10. Subject: Re:  xdvi: "pollable event"?
  11. In-Reply-To: <199402031105.AA24251@terminus.cs.umb.edu>
  12. References: <199402031105.AA24251@terminus.cs.umb.edu>
  13.  
  14. kb> I've seen this error on sgi's myself, but never had time to track
  15. kb> it down. Maybe someone else can give us a clue?
  16.  
  17. Isn't this the problem with SIGPOLL (or SIGIO) handlers installed
  18. incorrectly on SYSV/POSIX systems? If so, Martyn Johnson and I have
  19. posted patches for it.  I include the last one I sent to the list.
  20. -- 
  21. Simon.
  22.  
  23. ------- start of forwarded message (RFC 934) -------
  24. Return-Path: <simon@lia.di.epfl.ch>
  25. Received: from cs.umb.edu by liasun6.epfl.ch with smtp
  26.     (Smail3.1.28.1 #58) id m0pLyQY-0002P8C; Mon, 17 Jan 94 19:11 MET
  27. Received: from liasun6.epfl.ch by cs.umb.edu with SMTP id AA22059
  28.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Mon, 17 Jan 1994 12:39:03 -0500
  29. Received: by liasun6.epfl.ch (Smail3.1.28.1 #58)
  30.     id m0pLxum-0002P8C; Mon, 17 Jan 94 18:39 MET
  31. Message-Id: <m0pLxum-0002P8C@liasun6.epfl.ch>
  32. In-Reply-To: <"swan.cl.cam.:121540:931022092439"@cl.cam.ac.uk>
  33. References: <"swan.cl.cam.:121540:931022092439"@cl.cam.ac.uk>
  34. Content-Length: 2439
  35. From: simon@lia.di.epfl.ch (Simon Leinen)
  36. To: tex-k@cs.umb.edu
  37. Subject: xdvik-1.4: SIGIO handling broken for POSIX systems
  38. Date: Mon, 17 Jan 94 18:39 MET
  39. Content-Type: text
  40.  
  41. Hello,
  42.  
  43.   xdvik-1.4 includes a fix proposed by Martyn Johnson (see the
  44. referenced message to this list).  Unfortunately (1) the fix wasn't
  45. integrated correctly and (2) although the idea is good, the fix itself
  46. has a bug.  Martyn's fix was:
  47.  
  48. > Solution 2:
  49. >   Use "sigaction" rather than "signal", and set the SA_RESTART flag
  50. > explicitly.  I prefer this approach, because not all vendors may
  51. > follow Digital's approach of offering a whole family of alternative
  52. > compatibility modes.  A possible patch would be:
  53. > *** 1.1 1993/10/21 14:06:44
  54. > --- xdvi.c      1993/10/22 08:43:59
  55. > ***************
  56. > *** 2026,2032 ****
  57. > --- 2026,2036 ----
  58. >             if (dup2(socket, 0) == -1) perror(prog);
  59. >             socket = 0;
  60. >         }
  61. > + #ifdef SA_RESTART
  62. > +       (void) sigaction(SIGIO, (handle_intr, 0, SA_RESTART), NULL);
  63. > + #else
  64. >         (void) signal(SIGIO, handle_intr);
  65. > + #endif SA_RESTART
  66. >         (void) fcntl(socket, F_SETOWN, getpid());
  67. >         (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  68. >   }
  69.  
  70. but in xdvik/xdvi.c I see (lines 2029-2034):
  71.  
  72. #ifdef SA_RESTART
  73.         (void) sigaction(SIGIO, (handle_intr, 0, SA_RESTART), NULL);
  74. #else
  75.         (void) signal(SIGIO, handle_intr);
  76. #endif /* SA_RESTART */
  77.     (void) signal(SIGIO, handle_intr);
  78.  
  79. So there is one signal() call too much.  Probably this doesn't really
  80. matter.  The real problem is that the second parameter to sigaction()
  81. is wrong.  If I use this code under IRIX 5, I get spurious SIGIOs that
  82. terminate xdvi.  Here is a patch to xdvik-1.4 that fixes both bugs.
  83. -- 
  84. Simon.
  85.  
  86. *** xdvik/xdvi.c    1994/01/17 17:34:14    1.1
  87. --- xdvik/xdvi.c    1994/01/17 17:35:59    1.2
  88. ***************
  89. *** 2028,2036 ****
  90.       }
  91.   #ifdef SA_RESTART
  92. !         (void) sigaction(SIGIO, (handle_intr, 0, SA_RESTART), NULL);
  93.   #else
  94.           (void) signal(SIGIO, handle_intr);
  95.   #endif /* SA_RESTART */
  96. -     (void) signal(SIGIO, handle_intr);
  97.       (void) fcntl(socket, F_SETOWN, getpid());
  98.       (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  99. --- 2028,2041 ----
  100.       }
  101.   #ifdef SA_RESTART
  102. !     {
  103. !       struct sigaction sa;
  104. !       sa.sa_handler = handle_intr;
  105. !       sigemptyset (& sa.sa_mask);    
  106. !       sa.sa_flags = SA_RESTART;
  107. !       (void) sigaction(SIGIO, &sa, NULL);
  108. !     }
  109.   #else
  110.           (void) signal(SIGIO, handle_intr);
  111.   #endif /* SA_RESTART */
  112.       (void) fcntl(socket, F_SETOWN, getpid());
  113.       (void) fcntl(socket, F_SETFL, fcntl(socket, F_GETFL, 0) | FASYNC);
  114. ------- end -------